package com.youxuit.youxu.kecheng.SynchronizedDemo;

import lombok.SneakyThrows;

public class UnSafeShow1 implements Runnable{

    public static UnSafeShow1 unSafeShow1 = new UnSafeShow1();

    public static int j = 0;

    @Override
    public void run() {
        for (int i = 0; i < 1000; i++) {
            j = j+1;
        }

    }

    @SneakyThrows
    public static void main(String[] args) {
        Thread t1 = new Thread(unSafeShow1);
        Thread t2 = new Thread(unSafeShow1);
        t1.start();
        t2.start();
        t1.join();
        t2.join();
        System.out.println(j);
    }
}
